package com.heima.ssm.service.impl;

import com.github.pagehelper.PageHelper;
import com.heima.ssm.dao.IOrdersDao;
import com.heima.ssm.pojo.Orders;
import com.heima.ssm.service.IOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Penguin
 * @create Date 2021/5/4  Time 10:01
 */
@Service
@Transactional
public class OrdersServiceImpl implements IOrdersService {

    @Autowired
    private IOrdersDao ordersDao;

    @Override
    public List<Orders> findAll(int page,int pageSize) {
        PageHelper.startPage(page,pageSize);
        return ordersDao.findAll();
    }

    @Override
    public Orders findByOrdersId(int ordersId) {
        return ordersDao.findOrdersByOrdersId(ordersId);
    }
}
